﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RestSharp;

namespace ConsoleApplication5.Feature
{
    class FeatureSevenDataObtainer : DataObtainer
    {
        private IRestClient _client;
        public FeatureSevenDataObtainer(IRestClient restClient)
            : base(restClient)
        {
            _client = restClient;
        }

        public override string ObtainStringData(int movieId, MovieJson movieJson)
        {
            var request =
                new RestRequest("movie/" + movieJson.imdb_id + "/credits?api_key=d20b778e2233be6a4066a4e952164d2a");
            var result = _client.Execute<CreditItem>(request);
            var setter = new CrewSetter();
            setter.SetCrew(ref movieJson, result.Data.crew);
            return movieJson.director;
        }

        public override bool ObtainBoolData(int movieId, MovieJson movieJson)
        {
            throw new NotImplementedException();
        }
    }
}
